<script setup lang="ts">
import { onMounted } from 'vue'
import { useAuthStore } from '@/stores/auth'

const authStore = useAuthStore()

onMounted(async () => {
  // 应用挂载后再次确保用户状态是最新的
  if (!authStore.user) {
    await authStore.fetchMe()
  }
})
</script>

<template>
  <router-view />
</template>

<style scoped>
:root{--primary:#6366f1;--accent:#ef476f}
</style>
